home *** CD-ROM | disk | FTP | other *** search
/ Best Tools for JAVA / Best Tools for JAVA.iso / JAVA_ALL / IDE / SUBARTIC / SUB_ARCT / INPUT / RAW_POSI.JAV < prev    next >
Encoding:
Text File  |  1996-10-04  |  2.3 KB  |  70 lines

  1.  
  2. package sub_arctic.input;
  3.  
  4. import sub_arctic.lib.interactor;
  5.  
  6. /** 
  7.  * Positional input dispatch agent that delivers raw events.  This can be
  8.  * used as a hook for extensions.  This agent dispatches the raw_input_acceptor
  9.  * protocol to objects under the cursor at the time of the event.
  10.  *
  11.  * @see sub_arctic.input.raw_input_acceptor
  12.  * @author Scott Hudson
  13.  */
  14. public class raw_positional_agent extends dispatch_agent {
  15.  
  16.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  17.  
  18.   /** Simple constructor */
  19.   public raw_positional_agent()
  20.     {
  21.     }
  22.  
  23.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  24.  
  25.   /** 
  26.    * Attempt to dispatch a raw event from this agent.
  27.    *  
  28.    * @param event      evt       the event being dispatched.
  29.    * @param Object     user_info the information associated with this object at
  30.    *                             the time it was picked.
  31.    * @param interactor to_obj    the object we attempt to send the event to. 
  32.    * @param int        seq_num   the sequence number of the event.
  33.    * @returns boolean indication of whether the event was consumed or not.
  34.    */
  35.   public boolean dispatch_event(
  36.     event      evt,
  37.     Object     user_info,
  38.     interactor to_obj,
  39.     int        seq_num)
  40.     {
  41.       /* see if the object accepts this input -- if so try to dispatch*/
  42.       if (to_obj instanceof raw_input_acceptor)
  43.     {
  44.       /* put event in local coords of object and try to dispatch to it */
  45.       evt.global_to_local(to_obj);
  46.       return ((raw_input_acceptor)to_obj).handle_raw_input(evt,user_info);
  47.     }
  48.       else
  49.         return false;
  50.     }
  51.  
  52.   /* . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . */
  53. }
  54. /*=========================== COPYRIGHT NOTICE ===========================
  55.  
  56. This file is part of the subArctic user interface toolkit.
  57.  
  58. Copyright (c) 1996 Scott Hudson and Ian Smith
  59. All rights reserved.
  60.  
  61. The subArctic system is freely available for most uses under the terms
  62. and conditions described in 
  63.   http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html 
  64. and appearing in full in the lib/interactor.java source file.
  65.  
  66. The current release and additional information about this software can be 
  67. found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
  68.  
  69. ========================================================================*/
  70.